package com.jm88.${artifactIdPrefix};

import java.util.Hashtable;
import java.util.Map;

import javax.naming.NamingException;

/**
 * 
 * 
 */
public class MockJndiContext implements org.springframework.beans.factory.InitializingBean {

    private Map<String, Object> jndiObjects = new Hashtable<String, Object>();

    public void afterPropertiesSet() throws IllegalArgumentException, NamingException {
        if (jndiObjects != null) {
            for (String key : jndiObjects.keySet()) {
                JndiMockUtils.bind(key, jndiObjects.get(key));
            }
        }
    }

    public final Map<String, Object> getJndiObjects() {
        return jndiObjects;
    }

    public void setJndiObjects(Map<String, Object> jndiObjects) {
        this.jndiObjects = jndiObjects;
    }

}
